﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;

namespace MyFound.Wpf
{
    [ValueConversion(typeof(decimal),typeof(string))]
    public class ColorConvert : IValueConverter
    {
  
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            decimal? val = value as decimal?;
            if (val.HasValue)
            {
                return val>0? "Red":"Green";
            }

            return "Blue";
        }
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return "";
        }

      
    }
}
